class D0_file():
    def myRead(self,f,m,isUTF=False):
        if isUTF:
            with open(f,m,encoding='utf-8')as ff:
                # print(ff.read())
                return ff.read()
        else:
            with open(f,m)as ff:
                # print(ff.read())
                return ff.read()

    # t2 = r'F:\work\codings\python\pro_test\file\3456.jpg'
    # c = df.myRead(t1, 'rb')
    # df.myWitr(t2, 'wb', c)
    def myWitr(self,f,m,s,isUTF=False):
        if isUTF:
            with open(f,m,encoding='utf-8') as ff:
                ff.write(s)
                # return ff.write(s)
        else:
            with open(f,m)as ff:
                ff.write(s)
                # return ff.write(s)







if __name__ == '__main__':
    df=D0_file()
    # f1=r'F:\work\codings\python\pro_test\file\新建文本文档 (2).txt'
    # df.myRead(f1,'r',True)
    t1=r'F:\work\codings\python\pro_test\file\12.jpg'
    # df.myRead(t1,'rb')
    # df.myWitr(f1,'a','你好,朋友\n',True)
    t2=r'F:\work\codings\python\pro_test\file\3456.jpg'
    c=df.myRead(t1,'rb')
    # print(c)
    df.myWitr(t2,'wb',c)
    d=df.myWitr(t2,'wb',c)
